<template>
  <div class="app-container">
    <el-button type="text" @click="close()">返回</el-button>
    <el-table v-loading="loading" ref="table" :data="list">
      <el-table-column label="序号" align="center" type="index" width="80" sortable />
      <el-table-column label="名称" align="center" prop="name" />
      <el-table-column label="图标" align="center" prop="icon">
        <template slot-scope="scope">
          <el-avatar size="large" :src="scope.row.icon"></el-avatar>
        </template>
      </el-table-column>
      <el-table-column label="今日点击/曝光" align="center" prop="payDate" width="180" sortable>
        <template slot-scope="scope">
          <span>{{ scope.row.todayCount }}</span>
        </template>
      </el-table-column>
      <el-table-column label="昨日点击/曝光" align="center" prop="expireDate" width="180" sortable>
        <template slot-scope="scope">
          <span>{{ scope.row.yesterdayCount }}</span>
        </template>
      </el-table-column>
      <el-table-column label="周点击/曝光" align="center" prop="expireDate" width="180" sortable>
        <template slot-scope="scope">
          <span>{{ scope.row.weekCount }}</span>
        </template>
      </el-table-column>
      <el-table-column label="月点击/曝光" align="center" prop="expireDate" width="180" sortable>
        <template slot-scope="scope">
          <span>{{ scope.row.monthCount }}</span>
        </template>
      </el-table-column>
      <el-table-column label="总点击/曝光" align="center" prop="expireDate" width="180" sortable>
        <template slot-scope="scope">
          <span>{{ scope.row.todayCount }}</span>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" @pagination="getList" />

  </div>
</template>

<script>
import { getClubJobData } from "@/api/shuiyin/shuiyin";

export default {
  name: "ClubData",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 分页信息
      total: 0,
      pageNum: 1,
      pageSize: 10,
      // 选中角色编号
      roleIds:[],
      // 角色信息
      list: [],
      // 用户信息
      form: {}
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      this.loading = true;
      getClubJobData({pageNum: 1,pageSize: 10}).then((response) => {
        this.list = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 关闭按钮 */
    close() {
      this.$store.dispatch("tagsView/delView", this.$route);
      this.$router.push({ path: "/speardCenter/clubJob" });
    },
  },
};
</script>
